<template>
	<van-dialog
		confirm-button-text="关闭"
		@confirm="qr.visible = false"
		style="text-align: center"
		v-model:show="qr.visible"
		:title="userInfo.account + '的邀请码'"
	>
		<p class="text-center text-sm text-gray">向讲者出示二维码，邀请讲者扫码注册</p>
		<vue-qr :text="qr.content" :size="260"></vue-qr>
	</van-dialog>
</template>

<script setup>
import { useStore } from "vuex";
import {computed, reactive} from "vue";

const store = useStore()

const userInfo = computed(() => store.getters['user/getUserInfo'])

const qr = reactive({
	visible: false,
	content: ''
})

const init = (content = '') => {
	qr.content = content
	qr.visible = true
}

defineExpose({ init })
</script>

<style scoped>

</style>
